-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewards Greaselion - Twitter #6671
Conversation
72fcb96
to
6358b07
Compare
76f156c
to
84c283f
Compare
8645f8d
to
e28499a
Compare
f319632
to
c9d366b
Compare
c9d366b
to
3ccbeb2
Compare
const data = msg.data as MakeAPIRequest | ||
handleMakeAPIRequest(data, (response: any) => { | ||
port.postMessage({ | ||
type: 'MakeAPIRequest', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're using the same type
string for both the request and the response. Do you think it would be more clear to use different names (e.g. OnAPIRequest
, OnAPIResponse
, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had Request
and Response
appended to all message types for a while when writing the YouTube script. I feel like it didn't really help with clarity and just made things wordier. Once the background script began making requests, it only added to the confusion (at least for me!) I'm going to try to stick with this nomenclature for consistency right now.
return response.json() | ||
}) | ||
.then(responseData => sendResponse(responseData)) | ||
.catch(error => sendResponse(error)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we're sending both errors and valid responses through the "response" field into the content script. Does the content script know how to tell the difference? Perhaps the message to the content script should include both "response" and "error" fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, fixed.
3402f4c
to
cffc880
Compare
6affe6a
to
35cd56c
Compare
67f651f
to
cfa337d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
verified publisher doesn't have profile image https://twitter.com/lukemulks/status/1293113074317049856
-
should show publisher info https://twitter.com/brave/likes
current:
expected:
-
inline tip is not showing correct publisher. It should show TNW Events, but it shows Geertje as it was cited by TNW
https://twitter.com/tnwevents/status/1311659702598668288
current:
expected:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++
4551fd4
to
5285464
Compare
5285464
to
65aa51e
Compare
All CI platforms passed, waiting for final approval on brave/brave-site-specific-scripts#16 before merging. |
I believe this change has caused an issue where the embedded tip button can't be turned off. There was a test to check whether disabling Rewards also disabled the Tip button, but this PR includes a change that disables it in this commit. I might be wrong about this (first time looking at the codebase) but it looks like this PR rewrites the way the embedded tip buttons are created/rendered, but doesn't include any reference to the "props.rewardsData.inlineTip" preference, and so will be on by default no matter what the preference is set to. |
@johntringham After you disable the tip button, it requires you to restart the browser (we're working on removing that limitation). If you do that, is the button disabled for you? |
Yep, I've tried that (and several other things) - the Tip icon still appears. It looks like this bug is there for Twitter, Github and Reddit. This has been raised in several places over the last couple of months: Edit: Apologies - restarting the browser did fix it! I thought I had tried that but it looks like I had a couple of windows open in a different desktop, so the brave processes didn't fully end. Sorry about that - I'll stop posting on old PR's now :) |
@johntringham No worries at all, glad it's working. |
Resolves brave/brave-browser#11462
Resolves brave/brave-browser#6762
Resolves brave/brave-browser#5685
Resolves brave/brave-browser#4557
Resolves brave/brave-browser#8265
Associated Greaselion script PR: brave/brave-site-specific-scripts#16
Submitter Checklist:
npm run lint
,npm run gn_check
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Note: In order to test this PR, you must manually install the Twitter Greaselion script at the moment. This involves pulling down this branch and running the following commands (the example is Windows specific, it will need to be modified slightly for Mac/Linux):
Desktop
Standard URL
Excluded URL
Activity
activity_info
database table is updated as expectedHistory
Tab Activation
Tipping non-Twitter Publishers
Mobile
No changes were made to mobile platforms, so verify that Twitter navigation / tipping / Rewards panel continue to work as expected on those platforms.
Reviewer Checklist:
After-merge Checklist:
changes has landed on.